﻿(function () {
    "use strict";

    WinJS.UI.Pages.define("/pages/home/home.html", {
        // This function is called whenever a user navigates to this page. It
        // populates the page elements with the app's data.
        ready: function (element, options) {
            var register = document.getElementById("register").winControl;
            var login = document.getElementById("login").winControl;
            var contacts = document.getElementById("contacts").winControl;
            var addContact = document.getElementById("add-contact").winControl;
            var myEvents = document.getElementById("my-events").winControl;
            var createEvent = document.getElementById("create-event").winControl;

            register.addEventListener("tileinvoked", function() {
                goToRegister();
            });
            login.addEventListener("tileinvoked", function() {
                goToLogin();
            });
            contacts.addEventListener("tileinvoked", function() {
                goToContacts();
            });
            addContact.addEventListener("tileinvoked", function() {
                goToAddContact();
            });
            myEvents.addEventListener("tileinvoked", function() {
                goToMyEvents();
            });
            createEvent.addEventListener("tileinvoked", function() {
                goToCreateEvent();
            });
        }
    });
})();
var goToRegister = function() {
    WinJS.Navigation.navigate("/pages/register/register.html");
};
var goToLogin = function() {
    WinJS.Navigation.navigate("/pages/login/login.html");
};
var goToContacts = function() {
    WinJS.Navigation.navigate("/pages/contacts/contacts.html");
};
var goToAddContact = function() {
    WinJS.Navigation.navigate("/pages/accContacts/addContact.html");
};
var goToMyEvents = function() {
    WinJS.Navigation.navigate("/pages/myEvents/myEvents.html");
};
var goToCreateEvent = function() {
    WinJS.Navigation.navigate("/pages/addEvent/addEvent.html");
};